# -*- coding:utf-8 -*-
# @Author: komeiji satori
from distutils.log import debug
from imp import reload
from typing import Optional
import requests
import json
from fastapi import FastAPI, Query, Header, Request
import uvicorn
from fastapi.middleware.cors import CORSMiddleware
from app.routers.gaode import gaodeRouter
from app.routers.baidu import baiduRouter
from app.routers.test import testRouter
from app.routers.coord_transform import coordRouter
from app.routers.docs2pdf import docsRouter
app = FastAPI(title="地理信息转换")

'''
根路径函数
'''
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
'高德api代理转发'
app.include_router(gaodeRouter)
"百度api代理转发"
app.include_router(baiduRouter)
"经纬度转换"
app.include_router(coordRouter)
"文件上传"
app.include_router(docsRouter)
"测试案例"
app.include_router(testRouter)

if __name__ == "__main__":
    # 启动服务，因为我们这个文件叫做 main.py，所以需要启动 main.py 里面的 app
    # 第一个参数 "main:app" 就表示这个含义，然后是 host 和 port 表示监听的 ip 和端口
    uvicorn.run(app="main:app", host="0.0.0.0", port=9000,reload=True,debug=True)
